//山脉数组的峰顶索引
public class IndexInMountain {
    public int code(int[] arr) {
        int left = 1, right = arr.length - 2;
        while (left < right){
            int mid = left + (right - left + 1) / 2;
            if (arr[mid - 1] < arr[mid]){
                left = mid;
            }else{
                right = mid - 1;
            }
        }

        return left;
    }
}
